package com.yiduo.outpost.core.web.exception;

import org.springframework.context.MessageSource;

import java.util.Map;

/**
 * @author yanwen
 */
public interface ExceptionTranslator {

    boolean support(Throwable error);

    String translateException(Throwable error, MessageSource messageSource);

    default boolean supportFiled(Throwable error){
        return false;
    };

    default Map<String, Object> translateExceptionFiled(Throwable error, MessageSource messageSource){
        return null;
    };
}
